import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/rb-merchant/merchant/invoice/product/productList',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/rb-merchant/merchant/invoice/product/productInfo',
    method: 'get',
    params: {
      id
    }
  })
}

export const save = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/invoice/product/addProduct',
    method: 'post',
    data: row
  })
}

export const remove = (id) => {
  return request({
    url: '/api/rb-merchant/merchant/invoice/product/delProduct',
    method: 'get',
    params: {
      id,
    }
  })
}

/* 默认发票 */
export const add = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/invoice/product/add',
    method: 'post',
    data: row
  })
}

export const info = (invoiceKind, rpiNo) => {
  return request({
    url: '/api/rb-merchant/merchant/invoice/product/info',
    method: 'get',
    params: {
      invoiceKind,
      rpiNo
    }
  })
}